package br.gov.capgov.treinamento.jpa.entidades;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity(name="controle_de_quedas")
@NamedQuery(name="ControleDeQuedas.findAll", query="SELECT q FROM controle_de_quedas q")
public class ControleDeQuedas implements Serializable
{
	private static final long serialVersionUID = 1L;
	
	@Id
	@SequenceGenerator(name="controle_de_quedas_id_GENERATOR", sequenceName="controle_de_quedas_id_seq", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="controle_de_quedas_id_GENERATOR") 
	private Integer id;
	
	@Column(name="data")
	@Temporal(value=TemporalType.TIMESTAMP)
	private Date data;
	
	@Column(name="total_quedas")
	private Integer totalQuedas=0;
	
	@ManyToOne
	@JoinColumn(name="url2_id", referencedColumnName="id")
	private Url url;
	
	public ControleDeQuedas()
	{		
	}

	public Integer getId()
	{
		return id;
	}
	public void setId(Integer id)
	{
		this.id = id;
	}
	public Date getData()
	{
		return data;
	}
	public void setData(Date data)
	{
		this.data = data;
	}
	public Integer getTotalQuedas()
	{
		return totalQuedas;
	}
	public void setTotalQuedas(Integer totalQuedas)
	{
		this.totalQuedas = totalQuedas;
	}
	public Url getUrl()
	{
		return url;
	}
	public void setUrl(Url url)
	{
		this.url = url;
	}	
}